package com.zhuss.product.hotLineSite;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.zhuss.bean.bo.product.hotLineSite.CreateHotLineSiteBo;
import com.zhuss.bean.bo.product.hotLineSite.DeleteHotLineSiteBo;
import com.zhuss.bean.bo.product.hotLineSite.UpdateHotLineSiteBo;
import com.zhuss.bean.bo.product.hotLineSite.StartHotLineSiteBo;
import com.zhuss.bean.bo.product.hotLineSite.StopHotLineSiteBo;
import com.zhuss.common.OperateService;
import com.zhuss.common.Processor;
import com.zhuss.exception.DzcxException;

/**
 * @description: 热门线路站点操作的Service
 * @author: zhushanshuo
 * @create: Mon Jan 11 09:22:02 CST 2021
 **/
@Component("hotLineSiteOperateService")
public class HotLineSiteOperateService implements OperateService<Void, Object> {
	
	@Autowired
	@Qualifier("hotLineSiteCreate")
	private Processor<Object, CreateHotLineSiteBo> hotLineSiteCreate;
	
	@Autowired
	@Qualifier("hotLineSiteUpdate")
	private Processor<Object, UpdateHotLineSiteBo> hotLineSiteUpdate;
	
	@Autowired
	@Qualifier("hotLineSiteDelete")
	private Processor<Object, DeleteHotLineSiteBo> hotLineSiteDelete;
	

	
	/**
	 * 创建
	 */
	@Override
    @Transactional(rollbackFor = Exception.class)
	public Void create(Object param) throws DzcxException {
		
		CreateHotLineSiteBo bo = (CreateHotLineSiteBo) param;
		
		hotLineSiteCreate.process(bo);
		
		return null;
	}
    
	/**
	 * 修改
	 */
	@Override
    @Transactional(rollbackFor = Exception.class)
    public Void update(Object param) throws DzcxException {
    	
		UpdateHotLineSiteBo bo = (UpdateHotLineSiteBo) param;
		
		hotLineSiteUpdate.process(bo);
		
    	return null;
    }
	
	/**
	 * 删除
	 */
	@Override
	@Transactional(rollbackFor = Exception.class)
	public Void delete(Object param) throws DzcxException {
		
		DeleteHotLineSiteBo bo = (DeleteHotLineSiteBo) param;
		
		hotLineSiteDelete.process(bo);
		
		return null;
	}
	

	
}

